<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="~{common/header :: commonHead}">
    <title>限制详情</title>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="row form-body form-horizontal m-t" method="post" th:action="${'/square/add'}">
                        <input name="id" th:value="${editable?.id}" style="display: none">
                        <div class="col-md-12 droppable sortable ui-droppable ui-sortable">
                            <div class="form-group draggable ui-draggable dropped" style="position: static;">
                                <label class="col-sm-3 control-label">单个用户每日兑换次数：</label>
                                <div class="col-sm-6">
                                    <input type="text" name="count" id="count" class="form-control" th:value="${editable?.count }" placeholder="请输入每日限制兑换次数">
                                </div>
                            </div>
                            <div class="form-group draggable ui-draggable dropped" style="position: static;">
                                <label class="col-sm-3 control-label">是否生效：</label>
                                <div class="col-sm-6">
                                    <label class="radio-inline">
                                        <input type="radio" th:checked="${editable?.status == 0 || editable == null}" value="0" name="status">是
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" th:checked="${editable?.status == 1}" value="1" name="status">否
                                    </label>
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>

                            <div class="form-group draggable ui-draggable">
                                <div class="col-sm-12 col-sm-offset-3">
                                    <button class="btn btn-primary" id="submit-form" type="submit">保存内容</button>
                                </div>
                            </div>

                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:inline="javascript">
    let count;
    $("#submit-form").click(()=>{
        count = $("#count").val();
    if (count==null||count==''){
        layer.msg("请填写限制数量",{time: 1000})
        return false;
    }
    });


</script>
</body>
</html>